<?php
$interviewlist = $_['interviewlist'];
$intevpagination = $_['intevpagination'];
$app = PFactory::getApplication();
$limit = $app->getUserStateFromRequest('calendartodaylist.limit', 'limit', 20, 'int');
$today = PFactory::getDate();
$title_date = JHtml::_('date', $today, 'm月d日') . "&nbsp;&nbsp;" .$today->dayToString(JHtml::_('date', $today, 'w'), true);
?>
<script language="javascript" type="text/javascript">
   jQuery(document).ready(function($) {
      <?php if($intevpagination->pagesTotal > 1): ?>
         $("#interviewlist .list-footer:first").pager({ 
            pageCount: <?php echo $intevpagination->pagesTotal; ?>,
            currentPage: <?php echo ($intevpagination->pagesCurrent -1); ?>
         }).delegate("li.active", "click", function(e) {
            var page = parseInt($(this).attr('page'));
            var url = getUrlQuery(OC.filePath('calendar', 'ajax', 'getinterviewlist.php'),"limitstart=" + (page * <?=$limit?>)); 
            var target = $(this);
            $.ajax({
               url: url,
               beforeSend: function(xhr, settings) {
                  showLoading(target, settings, null, {button:true});
               },
               success: function(data) {
                  jQuery("#interviewlist").fadeOut("fast", function() { 
                     jQuery("#interviewlist").html(data).fadeIn(); 
                  }); 
               }
            })
         }).parent().show();
      <?php endif; ?>
   })
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
   <tr>
      <th class="lastone">
         <div class="todayevents clearfix">
            <span class="pull-left">今日日程</span>
            <a href="<?php echo OC_Helper::linkToRoute("calendar_home").'?adddialog=1'; ?>" class="ppp_whitebtn index_setinvite pull-right">安排面试</a>
            <span class="pull-right" style="margin-right:75px;"><?=$title_date ?></span>
         </div>
      </th>
   </tr>
   <?php if(empty($interviewlist)){ ?>
      <tr>
         <td class="nodatatd yahei lastone">
            暂无信息，请您先 <a id="setinterview" href="<?php echo OC_Helper::linkToRoute("calendar_home").'?adddialog=1'; ?>" style="margin-left:0px;">安排面试</a>
         </td>
      </tr>
   <?php }else{ ?>
      <?php
      foreach ($interviewlist as $key => $intevlist) {
         ?>
         <tr <?php echo ($key % 2 == 0)?"bgcolor='#fbfcfd'":''; ?>>
            <td class="lastone" id="showevent">
               <span class="todaytime">
               <?php echo JHtml::_('date',$intevlist->startdate, 'H:i') ?>
               </span>
               <a href="javascript:;" data-eventid="<?=$intevlist->id ?>">
                  <?php 
                     if($intevlist-> objecttype == "VEVENT"){
                        echo '<span class="vevent">面试</span>';
                     }
                     elseif($intevlist-> objecttype == "VTODO"){
                        echo '<span class="vtodo">入职</span>';
                     }
                     echo substr($intevlist->summary,9);
                  ?>
               </a>
            </td>
         </tr>
   <?php }} ?>
   <tr>
      <td colspan="5" class="row3" style="display: <?php echo ($intevpagination->pagesTotal > 1) ? '' : 'none'?>">
      <?php
         echo '<div class="list-footer"></div>'; 
      ?>
      </td>
   </tr>
</table>
<div id="fullcalendar" data-calid="<?php echo isset($interviewlist[0]->calendarid) ? $interviewlist[0]->calendarid : 0;?>" data-share="" data-userid=""></div>
 
